package main

import "fmt"

func main() {
	fmt.Println(typeTwo(1))

	fmt.Println(typeTwo2(1))

	fmt.Println(returnValue(1))

	fmt.Println(returnValue2(1))

	a, _ := returnValue(3)

	fmt.Println(a)

	//函数类型的值传递
	var f func(s int) (a, b int)

	f = returnValue2

	fmt.Println(f(2))

	fmt.Println(getString("aa"))
}

func typeTwo(a int) (b int, c string) {
	return a, "one"
}

func typeTwo2(int) (int, string) {
	return 1, "str"
}

func returnValue(s int) (a, b int) {
	a = 1
	b = 2
	return
}

func returnValue2(s int) (a, b int) {
	a = 1
	b = 2
	return a, 3
}

func getString(s string) string {
	return s
}
